//
//  Push_TitleController.swift
//  好书
//
//  Created by 魏忠海 on 2018/4/1.
//  Copyright © 2018年 WZH. All rights reserved.
//

import UIKit

typealias Push_TitleCallBack = (_ Title:String)->Void

class Push_TitleController: UIViewController {

    var textField:UITextField?
    
    var callBack:Push_TitleCallBack?
    
    /*
     *1. block
     *2. Delegate
     *3. 通知NSNotification
    **/
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        
        self.textField = UITextField(frame: CGRect(x: 15, y: 60, width: SCREEN_WIDTH - 30, height: 30))
        self.textField?.borderStyle = .roundedRect
        self.textField?.placeholder = "书评标题"
        self.textField?.font = UIFont(name: MY_FONT, size: 15)
        self.view.addSubview(self.textField!)
        self.textField?.becomeFirstResponder()
    }
    @objc func sure() {
        self.callBack!((self.textField?.text)!)
        self.dismiss(animated: true) {
            
        }
    }
    @objc func close() {
        self.dismiss(animated: true) {
            
        }
    }
    
}
